namespace CSharpTestDemo._0915;

public class phone
{
    public string Brand { get; set; }
    
    
    public double Weight { get; set; }
    
    
    public long CameraPixel { get; set; }
    

    public decimal Price { get; set; }
    
    
    public  phone(string brand, double weight, long cameraPixel, decimal price)
    {
        Brand = brand;
        Weight = weight;
        CameraPixel = cameraPixel;
        Price = price;
    }
    
   
    public void DisplayInfo()
    {
        Console.WriteLine("手机信息如下：");
        Console.WriteLine($"品牌：{Brand}");
        Console.WriteLine($"重量：{Weight}g");
        Console.WriteLine($"后置摄像头像素:{CameraPixel:N0}"); // 使用N0格式化显示千位分隔符
        Console.WriteLine($"价格：¥{Price}");
    }
}